|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The generic type of individuals.public interface IPopulation<T extends IIndividual<T>>
Common interface for populations of a GA.
Method Summary | |
---|---|
void |
addIndividual(T individual)
Adds an individual to the population. |
void |
addIndividuals(IndividualList<T> individuals)
Adds individuals to the population. |
void |
addIndividuals(T... individuals)
Adds individuals to the population. |
void |
clear()
Clears the population. |
boolean |
containsAny(IndividualList<T> list)
Determine if one of the individuals is contained in this list. |
void |
evaluateAutomatic()
Evaluates all individiduals using the automatic evaluator. |
T |
getEliteIndividual()
Gets the elite individual, if elite strategy is used. |
int |
getEvaluatedIndividualCount()
Get the number of individuals that has been evaluated. |
T |
getFittestIndividual()
Gets the individual if the highest fitness. |
IndividualList<T> |
getIndividuals()
Getter for a list representation of the population. |
int |
getInitIndividualCount()
Get the number of initial individuals. |
T |
getRandomIndividualForEvaluation()
Randomly selects an individual to evaluate. |
T |
getRandomIndividualForSelection()
Randomly selects an individual to select. |
IndividualList<T> |
getUnevaluatedIndividuals()
Get all individuals that has not been evaluated yet. |
T |
getUnfittestIndividual()
Gets the individual if the lowest fitness. |
void |
initRandomly(IValidator<T> validator,
GAContext context)
Fill the population with random individuals. |
boolean |
isAllowDuplicates()
Determines if duplicates are allowed. |
boolean |
isEmpty()
Determines if the population is empty. |
java.util.Iterator<T> |
iterator()
|
void |
setEvaluator(IFitnessEvaluator<T> evaluator)
Sets the evaluator. |
void |
setInitIndividualCount(int individualCount)
Set the number of initial individuals. |
int |
size()
Returns the size of the population; the count of individuals. |
Method Detail |
---|
void initRandomly(IValidator<T> validator, GAContext context)
validator
- The validator or null
.context
- The GA context.void setEvaluator(IFitnessEvaluator<T> evaluator)
evaluator
- The evaluator.IndividualList<T> getIndividuals()
void addIndividuals(T... individuals)
individuals
- Individuals to add.void addIndividual(T individual)
individual
- Individual to add.void addIndividuals(IndividualList<T> individuals)
individuals
- Individuals to add.void clear()
void evaluateAutomatic()
boolean isEmpty()
true
if the population is empty.int size()
T getUnfittestIndividual()
T getFittestIndividual()
T getEliteIndividual()
null
.T getRandomIndividualForEvaluation()
IndividualList<T> getUnevaluatedIndividuals()
int getEvaluatedIndividualCount()
int getInitIndividualCount()
void setInitIndividualCount(int individualCount)
individualCount
- Number of init individuals.boolean isAllowDuplicates()
true
if duplicates are allowed.boolean containsAny(IndividualList<T> list)
list
- Individuals to look for.
true
if this list contains any individual of the other
one.java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T extends IIndividual<T>>
T getRandomIndividualForSelection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |